package com.ytkj.digitalConstruction.httpbean.user;

import java.util.Date;
import java.util.List;

import javax.validation.constraints.Size;

import com.ytkj.digitalConstruction.entity.user.User;

/**
 * 
 * @author Pete
 * @author momei
 * @Date 2017年12月11日
 */
public class ReqUser extends User {

	@Size(min = 1, message = "用户角色至少必须有一个")
	private List<Integer> roleIds;

	@Size(min = 1, message = "用户部门至少必须有一个")
	private List<Integer> deptIds;
	

	public List<Integer> getRoleIds() {
		return roleIds;
	}

	public void setRoleIds(List<Integer> roleIds) {
		this.roleIds = roleIds;
	}

	public List<Integer> getDeptIds() {
		return deptIds;
	}

	public void setDeptIds(List<Integer> deptIds) {
		this.deptIds = deptIds;
	}

	public User user() {
		User user = new User();
		user.setUserId(this.getUserId());
		user.setName(this.getName());
		user.setUserName(this.getUserName());
		user.setPosition(this.getPosition());
		user.setEmail(this.getEmail());
		user.setTel(this.getTel());
		user.setMobile(this.getMobile());
		user.setPasswd(this.getPasswd());
		user.setStatus(1);
		user.setLastLogin(new Date());
		user.setIsManager(this.getIsManager());
		return user;
	}

}
